<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8" %>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>



<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<script type="text/javascript" src="<%=basePath %>js/jquery.js"></script>
 	<script type="text/javascript" src="../js/jquery-1.7.1.min.js"></script>
<title>考试系统</title>
<style type="text/css">
<!--
body {
	margin-left: 3px;
	margin-top: 0px;
	margin-right: 3px;
	margin-bottom: 0px;
}
.STYLE1 {
	color: #e1e2e3;
	font-size: 12px;
}
.STYLE6 {color: #000000; font-size: 12; }
.STYLE10 {color: #000000; font-size: 12px; }
.STYLE11 {color: red; font-size: 12px; }
.STYLE19 {
	color: #344b50;
	font-size: 12px;
}
.STYLE21 {
	font-size: 12px;
	color: #3b6375;
}
.STYLE22 {
	font-size: 12px;
	color: #295568;
}
-->
</style>
</head>

<script type="text/javascript">
	var flag = false;
	function check_classnum(){
		$("#info").text("");
		var num = $("#classnum").val();
		$.get("<%=request.getContextPath()%>/Clazz/ClazzAction!checkNum.action", {num:num}, callback);
	}
	
	function callback(data){
		if(data == "" || data == null ){    //表示班级存在
			$("#info").text("该班号以存在！请重新输入");
		}
		else{
			flag = true;
		}
		
	}
	
	function go(){
		if(flag){
			$("#form1").submit();
		}
	}

</script>

<body>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="6%" height="19" valign="bottom"><div align="center"><img src="images/tb.gif" width="14" height="14" /></div></td>
                <td width="94%" valign="bottom"><span class="STYLE1"> 添加班级</span></td>
              </tr>
            </table>
            </td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
  <td>
    <form name="form1" id="form1" action="<%=path %>/Clazz/ClazzAction!addClazz.action" method="post">
	<table width="30%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
		<tr>
			 <td width="30%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">班号 </span></div></td>
			 <td height="20" bgcolor="d3eaef" class="STYLE19"><div align="center"><input type="text" name="classnum" id="classnum" onblur="check_classnum()" maxlength="20" size="35"/> </div></td>
		</tr>
		<tr>
			 <td width="30%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">专业名</span></div></td>
			 <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="left"> <input type="text" name="classname" maxlength="15" size="35" /> </div></td>
		</tr>
		
		<tr>
			<td width="30%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10"> <input type="button" value="提交" onclick="go()" /></span></div></td>
			<td height="20"  class="STYLE19"><div align="center"><input type="reset" value="重置" /> </div></td>
		</tr>
		
		<tr>
			<td  height="20" bgcolor="d3eaef" class="STYLE6" colspan="2"><div align="center"><span id="info" class="STYLE11"></span></div></td>
		</tr>
		
	</table>
	</form>
  </td>
  </tr>
</table>	
    		
</body>
</html>
